<extend name="template/base_index" />

<block name="area_header">
    <style type="text/css">
        img{
            height:20px;
            width:20px;
        }
    </style>
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <h3>当前商品:</h3>{$product.name}<br/>
            <volist name="sku" id="vo">
                {$vo.id.id_name}:{$vo.vid.vid_name}<br/>
            </volist>
            <form method="post" class="form-inline searchForm">
                <input type="hidden" id="pid" name="pid" value="{$product.id}"/>
                <input type="hidden" id="sku_id" name="sku_id" value="{$sku_id}"/>
                <input type="hidden" id="startdatetime" name="startdatetime" value="{$startdatetime}"/>
                <input type="hidden" id="enddatetime" name="enddatetime" value="{$enddatetime}"/>
                <label>类型选择:</label>
                <select class="form-control input-short input-sm type-select" name="dtree_type">
                    <option value="0">= 全部 =</option>
                    {:W("Partials/datatree",array(getDatatree('QUANTITY_TYPE'),true))}
                </select>
            </form>
            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />ID
                    </th>
                    <th>
                        变动类型
                    </th>
                    <th>
                        变动数量
                    </th>
                    <th>
                        剩余库存
                    </th>
                    <th>
                        变动时间
                    </th>
                    <th>
                        操作时间
                    </th>
                    <th>
                        操作人
                    </th>
                </tr>
                </thead>
                <tbody>
                <empty name="list">
                    <tr>
                        <td colspan="6" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo">
                        <tr>
                            <td>
                                {$vo.id}
                            </td>
                            <td>
                                {$vo.dtree}
                            </td>
                            <td>
                                {$vo.change}
                            </td>
                            <td>
                                {$vo.left_quantity|round}
                            </td>
                            <td>
                                {$vo.change_time|date='Y-m-d H;i:s',###}
                            </td>
                            <td>
                                {$vo.create_time|date='Y-m-d H;i:s',###}
                            </td>
                            <td>
                                {$vo.operator_name}
                            </td>
                        </tr>

                    </volist>
                </empty>
                </tbody>
            </table>
            <div>{$show}</div>
        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">
    <script type="text/javascript">
        $(function(){
            $('.type-select option').click(function(){
                var dtree_type = $(this).val();
                var pid = $('#pid').val();
                var sku_id = $('#sku_id').val();
                var startdatetime = $('#startdatetime').val();
                var enddatetime = $('#enddatetime').val();
                var url = window.location.href;
                url = url + "?pid=" + pid + "&sku_id=" + sku_id +"&startdatetime=" + startdatetime + "&enddatetime=" + enddatetime + "&dtree_type=" + dtree_type;
                window.location.href = url;
            });
        });
    </script>
</block>
